package lab05;

import java.util.Scanner;
public class task5 {

	public static void main(String[] args) {
		
		String str1 ,str2;
		int Ls1 ,Ls2 , c;
		Scanner sk = new Scanner(System.in);
	
		System.out.println("Enter a string1 of length <=20:");
		str1 = sk.nextLine();
		Ls1 = str1.length();
		if(Ls1 > 20)
		{
			System.out.print("Error: the length of string1 > 20");
			//exit(1);
		}
		else
		{
			System.out.println("Enter a string2 of length <=20:");
			str2 = sk.nextLine();
			Ls2 = str2.length();
			if(Ls2 > 20)
			{
				System.out.print("Error: the length of string2 > 20");
			//	exit(1);
			}
			else
			{
				c = str1.compareTo(str2);
				if(c < 0)
					System.out.print("String2 is greater than String1");
				else if(c > 0)
					System.out.print("String1 is greater than String2");
				else
					System.out.print("String1 and String2 are equal");
			}
		}
		

	}

}
